scVAT can build VATEntity object from Single-Cell RNA-seq data from a csv, sparse mtx or h5 file. Firstly, loading scVAT package
library(scVAT)
#> Warning: replacing previous import 'igraph::groups' by 'plotly::groups'
#> when loading 'scVAT'
#> Warning: replacing previous import 'shiny::dataTableOutput' by
#> 'DT::dataTableOutput' when loading 'scVAT'
#> Warning: replacing previous import 'shiny::renderDataTable' by
#> 'DT::renderDataTable' when loading 'scVAT'Loading raw data from CSV File, then initializing VATEntity object
#loading expression matrix from CSV, The csv file should contain genes in the row and cells in the columns.
BHSC.data <- loadCSVData("BHSC.csv")
#initializing VATEntity object using loaded data
BHSC <- initVATEntity(BHSC.data, title="BHSC")
#> 2018-03-28 16:15:46 create VAT Entity...
#> 2018-03-28 16:15:49 Filtering cells and genes...
#> 2018-03-28 16:15:49 Scaling and Normalizing data...
#> 2018-03-28 16:15:53 It's done!
#print BHSC
BHSC
#> An object of VATEntity in dataset' BHSC '
#> 15616 genes, 2143 cells.Running the base pipline, including PCA, t-SNE, and Cluster
#do PCA, pc.num = 50
BHSC <- doPCA(BHSC, pc.num = 50)
#Plot PC standard deviation
plotPCASDev(BHSC)
#> Warning: package 'bindrcpp' was built under R version 3.4.3#do tSNE, using PC1~50
BHSC <- doTSNE(BHSC, dims = 2, use.col = 50)scVAT can integrate the third party anlaysis results, and visualizing them. For the demo, Loading PHATE result(via)
#specifying data file, dimensions and key value (important, the key will be used later)
BHSC <- loadAnalysisFromCSV(BHSC, "BHSC_PHATE.csv", ndims =3, key="PHATE")#plot one gene expression based on t-SNE
plotGene(BHSC, genes="Cdc20", dims = c(1,2))#plot one gene expression based on t-SNE, no gradient, and different colors
plotGene(BHSC, genes="Cdc20", gradient= FALSE, dims = c(1,2), colors=c("grey","red"))#plot one gene expression based on PHATE
plotGene(BHSC, genes="Cdc20", dims = c(1,2), key="PHATE")#plot one gene expression based on PHATE (3D),parameters size and sizes set point size for 3D maps
plotGene(BHSC, genes="Cdc20", dims = c(1,2,3), key="PHATE",size=1,sizes=c(1,5))#plot two genes based on tSNE
plotTwoGenes(BHSC, gene1 = "Cdc20",gene2 = "Gata1")#plot two genes based on tSNE, and use different colors
plotTwoGenes(BHSC, gene1 = "Cdc20",gene2 = "Gata1",colors=c("grey","blue","red","black"))#plot two genes based on PHATE, and use different colors
plotTwoGenes(BHSC, gene1 = "Cdc20", gene2 = "Gata1", dims=c(1,2,3),key = "PHATE", size=1, sizes=c(1,5))#plot three genes based on PHATE
plotThreeGenes(BHSC, gene1 = "Cdc20", gene2 = "Gata1", gene3 = "Klf1", dims=c(1:3),key="PHATE", size =1, sizes = c(1,5))#Plot many genes at the sametime, nrows sets row number
plotGenes(BHSC, genes = c("Cdc20","Gata1","Klf1","Ube2c"), nrows=2)#start Web GUI for visualization, clustering manually, and differential analysis
startVATGUI("BHSC")
#> Loading required package: shiny
#> Warning: package 'shiny' was built under R version 3.4.3
#> Loading required package: shinydashboard
#> Warning: package 'shinydashboard' was built under R version 3.4.3
#>
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#>
#> box
#> Loading required package: plotly
#> Warning: package 'plotly' was built under R version 3.4.3
#> Loading required package: ggplot2
#> Warning: package 'ggplot2' was built under R version 3.4.3
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
#>
#> Listening on http://127.0.0.1:7735The html_vignette template includes a basic CSS theme. To override this theme you can specify your own CSS in the document metadata as follows:
output:
rmarkdown::html_vignette:
css: mystyles.css
The figure sizes have been customised so that you can easily put two images side-by-side.
plot(1:10)
plot(10:1)You can enable figure captions by fig_caption: yes in YAML:
output:
rmarkdown::html_vignette:
fig_caption: yes
Then you can use the chunk option fig.cap = "Your figure caption." in knitr.
You can write math expressions, e.g. \(Y = X\beta + \epsilon\), footnotes1, and tables, e.g. using knitr::kable().
| mpg | cyl | disp | hp | drat | wt | qsec | vs | am | gear | carb | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Mazda RX4 | 21.0 | 6 | 160.0 | 110 | 3.90 | 2.620 | 16.46 | 0 | 1 | 4 | 4 |
| Mazda RX4 Wag | 21.0 | 6 | 160.0 | 110 | 3.90 | 2.875 | 17.02 | 0 | 1 | 4 | 4 |
| Datsun 710 | 22.8 | 4 | 108.0 | 93 | 3.85 | 2.320 | 18.61 | 1 | 1 | 4 | 1 |
| Hornet 4 Drive | 21.4 | 6 | 258.0 | 110 | 3.08 | 3.215 | 19.44 | 1 | 0 | 3 | 1 |
| Hornet Sportabout | 18.7 | 8 | 360.0 | 175 | 3.15 | 3.440 | 17.02 | 0 | 0 | 3 | 2 |
| Valiant | 18.1 | 6 | 225.0 | 105 | 2.76 | 3.460 | 20.22 | 1 | 0 | 3 | 1 |
| Duster 360 | 14.3 | 8 | 360.0 | 245 | 3.21 | 3.570 | 15.84 | 0 | 0 | 3 | 4 |
| Merc 240D | 24.4 | 4 | 146.7 | 62 | 3.69 | 3.190 | 20.00 | 1 | 0 | 4 | 2 |
| Merc 230 | 22.8 | 4 | 140.8 | 95 | 3.92 | 3.150 | 22.90 | 1 | 0 | 4 | 2 |
| Merc 280 | 19.2 | 6 | 167.6 | 123 | 3.92 | 3.440 | 18.30 | 1 | 0 | 4 | 4 |
Also a quote using >:
“He who gives up [code] safety for [code] speed deserves neither.” (via)
A footnote here.↩